/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package vn.com.aptech.msh.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author trietto
 */
@Entity
@Table(name = "sellinghouse")
@NamedQueries({
    @NamedQuery(name = "SellingHouse.findAll", query = "SELECT s FROM SellingHouse s")})
public class SellingHouse implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "AdvertisingID")
    private Integer advertisingID;
    @Basic(optional = false)
    @Column(name = "City")
    private String city;
    @Basic(optional = false)
    @Column(name = "Location")
    private String location;
    @Basic(optional = false)
    @Column(name = "Price")
    private double price;
    @Basic(optional = false)
    @Column(name = "PriceType")
    private boolean priceType;
    @Basic(optional = false)
    @Column(name = "SquareFootage")
    private double squareFootage;
    @Basic(optional = false)
    @Column(name = "NoOfBedrooms")
    private int noOfBedrooms;
    @Basic(optional = false)
    @Column(name = "NoOfBathrooms")
    private int noOfBathrooms;
    @Column(name = "ExtraFacilities")
    private String extraFacilities;
    @Column(name = "Furniture")
    private String furniture;
    @Column(name = "ModesOfTransport")
    private String modesOfTransport;
    @Basic(optional = false)
    @Column(name = "ContactDetails")
    private String contactDetails;
    @Column(name = "ModeOfPayment")
    private String modeOfPayment;
    @JoinColumn(name = "HouseTypeID", referencedColumnName = "HouseTypeID")
    @ManyToOne(optional = false)
    private HouseType houseType;
    @JoinColumn(name = "AdvertisingID", referencedColumnName = "AdvertisingID", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Advertising advertising;

    public SellingHouse() {
    }

    public SellingHouse(Integer advertisingID) {
        this.advertisingID = advertisingID;
    }

    public SellingHouse(Integer advertisingID, String city, String location, double price, boolean priceType, double squareFootage, int noOfBedrooms, int noOfBathrooms, String contactDetails) {
        this.advertisingID = advertisingID;
        this.city = city;
        this.location = location;
        this.price = price;
        this.priceType = priceType;
        this.squareFootage = squareFootage;
        this.noOfBedrooms = noOfBedrooms;
        this.noOfBathrooms = noOfBathrooms;
        this.contactDetails = contactDetails;
    }

    public Integer getAdvertisingID() {
        return advertisingID;
    }

    public void setAdvertisingID(Integer advertisingID) {
        this.advertisingID = advertisingID;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public boolean getPriceType() {
        return priceType;
    }

    public void setPriceType(boolean priceType) {
        this.priceType = priceType;
    }

    public double getSquareFootage() {
        return squareFootage;
    }

    public void setSquareFootage(double squareFootage) {
        this.squareFootage = squareFootage;
    }

    public int getNoOfBedrooms() {
        return noOfBedrooms;
    }

    public void setNoOfBedrooms(int noOfBedrooms) {
        this.noOfBedrooms = noOfBedrooms;
    }

    public int getNoOfBathrooms() {
        return noOfBathrooms;
    }

    public void setNoOfBathrooms(int noOfBathrooms) {
        this.noOfBathrooms = noOfBathrooms;
    }

    public String getExtraFacilities() {
        return extraFacilities;
    }

    public void setExtraFacilities(String extraFacilities) {
        this.extraFacilities = extraFacilities;
    }

    public String getFurniture() {
        return furniture;
    }

    public void setFurniture(String furniture) {
        this.furniture = furniture;
    }

    public String getModesOfTransport() {
        return modesOfTransport;
    }

    public void setModesOfTransport(String modesOfTransport) {
        this.modesOfTransport = modesOfTransport;
    }

    public String getContactDetails() {
        return contactDetails;
    }

    public void setContactDetails(String contactDetails) {
        this.contactDetails = contactDetails;
    }

    public String getModeOfPayment() {
        return modeOfPayment;
    }

    public void setModeOfPayment(String modeOfPayment) {
        this.modeOfPayment = modeOfPayment;
    }

    public HouseType getHouseType() {
        return houseType;
    }

    public void setHouseType(HouseType houseType) {
        this.houseType = houseType;
    }

    public Advertising getAdvertising() {
        return advertising;
    }

    public void setAdvertising(Advertising advertising) {
        this.advertising = advertising;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (advertisingID != null ? advertisingID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SellingHouse)) {
            return false;
        }
        SellingHouse other = (SellingHouse) object;
        if ((this.advertisingID == null && other.advertisingID != null) || (this.advertisingID != null && !this.advertisingID.equals(other.advertisingID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "vn.com.aptech.msh.entities.SellingHouse[advertisingID=" + advertisingID + "]";
    }

}
